﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewstorePlateformeDAO
{
    public partial class C_activites_utilisateur
    {
        public static bool Insert(int utilisId, int activiteId)
        {
            bool created = false;

            using (Newstore_PL_GOLD_BDDEntities context = new Newstore_PL_GOLD_BDDEntities(EntitiesHelper.connexionString))
            {
                C_activites_utilisateur activite = new C_activites_utilisateur
                {
                    dateDebut = DateTime.Now,
                    idActivites = activiteId,
                    idUtilisateur = utilisId
                };
                created = activite.Add(context) > 0 ? true : false;
            }

            return created;
        }
    }
}
